package cn.com.clearbus.service.fallback;

import cn.com.clearbus.dto.response.ResultBean;
import cn.com.clearbus.entity.CUser;
import cn.com.clearbus.service.UserService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFallBackFactory implements FallbackFactory<UserService> {

    @Override
    public UserService create(Throwable throwable) {
        return new UserService(){
            @Override
            public Object discovery() {
                return "service stop";
            }

            @Override
            public CUser getUser(String id) {
                return null;
            }

            @Override
            public ResultBean deleteUser(String id) {
                return new ResultBean();
            }

            @Override
            public CUser saveUser(CUser cUser) {
                return null;
            }

            @Override
            public ResultBean updateUser(String id) {
                return null;
            }
        };
    }
}
